package baseTest;

import java.util.LinkedList;

public class lengthOfLis {
    public static void main(String[] args) {
        LinkedList linkedList = new LinkedList();
        linkedList.poll();
        int[] nums ={1,3,6,7,9,4,10,5,6};
        System.out.println(lengthOfLIs(nums));
    }
    public static int lengthOfLIs(int[] nums) {
        int[] ans = new int[nums.length];
        ans[0] = 1;
        int max = ans[0];
        for (int i = 1; i < nums.length; i++) {
            ans[i] = 1;
            int cur = i;
            while (cur >= 0) {
                if (nums[i] > nums[cur] && ans[cur] >= ans[i]) {
                    ans[i] = ans[cur] + 1;
                }
                cur--;
            }
        max = Math.max(max, ans[i]);
        ans[i] = max;
    }
        return max;
    }

}
